-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EC2 SSH key use user data #68
Conversation
Instead of requiring key-pair name.
7a56c18
to
53b3af8
Compare
This is snot a good idea. If the code that handles user data is broken, and we probably want a test for that in IPA ;) then debugging is basically impossible as one cannot login. |
If the code is in EC2 what precludes key-pair code from also being broken? |
We also decided that from MASH the instances are not debuggable. So why can't this be an option? Provide optional ssh-key name which takes precedence over user-data. |
@rjschwei There's a plethora of ways an instance could end up un-reachable which cannot be distinguished by IPA.
From an automated testing standpoint all we can do is log a generic failure that instance is not reachable. And fail the test. Then if ssh-key and user-data were interchangeable options one could manually test both with IPA. So IMHO this would be an advantage. Now the user can use IPA to test cloud-init issues. Otherwise the user would have to use a separate tool/method if debugging cloud-init problem. |
If provided instance is launched using the ssh key name. Otherwise the instance the ssh public key is added via user-data and cloud init.
Reopening with amended commit. I think allowing for optional ssh key name solves the concern of debugging instances with cloud init issues. And default use of cloud-init user-data gives an added implicit test for user-data handling in images. |
1.) The proposed implementation was not optional, it was for removing the the ssh-key argument having an optional implementation is a different discussion |
Right, but the PR was closed prematurely without providing an opportunity to discuss possible resolutions for your concerns. Which I think making it optional is certainly worth consideration. Since that means from an API standpoint nothing that was available in regards to ssh key names has been removed. And if provided the key name is still used by default.
Right, but whether or not they are user created doesn't matter. In any of the scenarios IPA cannot provide a more useful error aside from, "The instance is unreachable". But this should be moved to a different discussion thread. |
Instead of using cloud-init a bash script removes more variables from the equation.
0cf0a7b
to
f9b5ed7
Compare
ipa/ipa_ec2.py
Outdated
""" | ||
key = ipa_utils.generate_public_ssh_key(self.ssh_private_key).decode() | ||
data = BASH_SSH_SCRIPT.format(user=self.ssh_user, key=key) | ||
return data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not data, the value returned is the actual script, i.e. name it "script"
Update docstring to reflect return value type.
Use user data to add SSH public key to instance on EC2 launch when ssh key name is not provided.